package com.lnking.lnkingplace.controller;


import com.lnking.common.http.ReturnResult;
import com.lnking.lnkingplace.model.request.user.UserSearchRequest;
import com.lnking.lnkingplace.service.IMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangqt
 * @since 2022-11-24
 */
@RestController
@Api(tags = "短信模块")
@RequestMapping("/message")
public class MessageController {

    @Autowired
    IMessageService messageService;

    @ApiOperation("发送验证码")
    @GetMapping("/send/code")
    public ReturnResult send(String phone) throws Exception {
        messageService.send(phone);
        return ReturnResult.success();
    }


    @ApiOperation("发送验证码(隔离)")
    @GetMapping("/send/code/isolation")
    public ReturnResult sendIsolation(String phone) throws Exception {
        messageService.sendIsolation(phone);
        return ReturnResult.success();
    }

}
